
package vn.fpt.fsoft.entities;




import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * Author:	DuongPV1
 * Entity Organisation mapping with table Organisation in database
 * 
 * */
@Entity
@Table(name="Organisation")
public class Organisation implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6635704947129890877L;
	private int orgId;
	private String organisationName;
	/*private Contact contact;*/
	private String shortDecription;
	/*private TypeOfBusiness typeOfBusiness;	*/	
	private String phoneNumber;
	private Boolean status;	
	private Boolean preferred;
	private Boolean expression;
	private String fullDecription;
	private String fax;
	private String email;
	private String webAddress;
	private String charityNumber;
	private String companyNumber;
	/*private Set<Directorate> directorates;
	private Set<Service> organisationService;
	private Set<SupportingMaterial> supportingMaterials;
	private Set<Programme> programme;*/
	/*private Address address;*/
	/*private Set<ReferenceData> referenceData;*/
	
	public Organisation() {
		// TODO Auto-generated constructor stub
	}

	

	@Id
	@GeneratedValue
	@Column(name="OrgId", unique=true, nullable=false)
	public int getOrgId() {
		return orgId;
	}

	public void setOrgId(int orgId) {
		this.orgId = orgId;
	}
	@Column(name="OrganisationName",length=50,nullable=true)
	public String getOrganisationName() {
		return organisationName;
	}

	public void setOrganisationName(String organisationName) {
		this.organisationName = organisationName;
	}

	/*@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ContactId",nullable=true)
	public Contact getContact() {
		return contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}*/
	@Column(name="ShortDecription",nullable=true)
	public String getShortDecription() {
		return shortDecription;
	}

	public void setShortDecription(String shortDecription) {
		this.shortDecription = shortDecription;
	}
	/*@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="BusinessId", nullable=true)
	public TypeOfBusiness getTypeOfBusiness() {
		return typeOfBusiness;
	}

	public void setTypeOfBusiness(TypeOfBusiness typeOfBusiness) {
		this.typeOfBusiness = typeOfBusiness;
	}
*/
	@Column(name="PhoneNumber",length=20,nullable=true)
	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	@Column(name="Status",nullable=true)
	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}
	@Column(name="Preferred",nullable=true)
	public Boolean getPreferred() {
		return preferred;
	}

	public void setPreferred(Boolean preferred) {
		this.preferred = preferred;
	}
	@Column(name="Expression",nullable=true)
	public Boolean getExpression() {
		return expression;
	}

	public void setExpression(Boolean expression) {
		this.expression = expression;
	}
	@Column(name="FullDecription",nullable=true)
	public String getFullDecription() {
		return fullDecription;
	}

	public void setFullDecription(String fullDecription) {
		this.fullDecription = fullDecription;
	}
	@Column(name="Fax",nullable=true)
	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}
	@Column(name="Email",length=30,nullable=true)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	@Column(name="WebAddress",nullable=true)
	public String getWebAddress() {
		return webAddress;
	}

	public void setWebAddress(String webAddress) {
		this.webAddress = webAddress;
	}
	@Column(name="CharityNumber",nullable=true)
	public String getCharityNumber() {
		return charityNumber;
	}

	public void setCharityNumber(String charityNumber) {
		this.charityNumber = charityNumber;
	}
	@Column(name="CompanyNumber",nullable=true)
	public String getCompanyNumber() {
		return companyNumber;
	}

	public void setCompanyNumber(String companyNumber) {
		this.companyNumber = companyNumber;
	}
	/*@OneToMany(fetch=FetchType.LAZY,mappedBy="organisation")
	public Set<Directorate> getDirectorates() {
		return directorates;
	}

	public void setDirectorates(Set<Directorate> directorates) {
		this.directorates = directorates;
	}
	
	@ManyToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinTable(name="Organisation_Service",
		joinColumns={@JoinColumn(name="OrgId",nullable=false,updatable=false)},
		inverseJoinColumns={@JoinColumn(name="ServiceId",nullable=false,updatable=false)}
	)
	public Set<Service> getOrganisationService() {
		return organisationService;
	}

	public void setOrganisationService(Set<Service> organisationService) {
		this.organisationService = organisationService;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="organisation")
	public Set<SupportingMaterial> getSupportingMaterials() {
		return supportingMaterials;
	}

	public void setSupportingMaterials(Set<SupportingMaterial> supportingMaterials) {
		this.supportingMaterials = supportingMaterials;
	}
	
	@ManyToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinTable(name="Organisation_Programme",
		joinColumns={@JoinColumn(name="OrgId",nullable=false,updatable=false)},
		inverseJoinColumns={@JoinColumn(name="ProgrammeId",nullable=false,updatable=false)}
	)
	public Set<Programme> getProgramme() {
		return programme;
	}

	public void setProgramme(Set<Programme> programme) {
		this.programme = programme;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="AddressID",nullable=true)
	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}
	@ManyToMany(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinTable(name="Organisation_ReferenceData",
		joinColumns={@JoinColumn(name="OrgId",nullable=false,updatable=false)},
		inverseJoinColumns={@JoinColumn(name="RefId",nullable=false,updatable=false)}
	)
	public Set<ReferenceData> getReferenceData() {
		return referenceData;
	}

	public void setReferenceData(Set<ReferenceData> referenceData) {
		this.referenceData = referenceData;
	}	
	*/
}

